package KK.Cache
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.utils.getTimer;

	public class Cache
	{
		public var data:*;
		public var cacheTime:int;
		private  var idle:int;//空闲时间
		public function Cache(data:*,idle:int):void{
			this.data=data;
			this.idle=idle;
			cacheTime=idle*1000;
			Update();
		}

		/**
		 * 移除 
		 * 
		 */
		public function Remove():void{
			data is BitmapData&&BitmapData(data).dispose();
		}
		
		public function Update():void{
			
			this.cacheTime=(idle*1000)+getTimer(); 
		}
	}
}